<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    用户账号：<li sec:authentication="principal.username"></li>
    用户权限：<li sec:authentication="principal.authorities"></li>
    没有过期：<li sec:authentication="principal.accountNonExpired"></li>
    没有锁定：<li sec:authentication="principal.accountNonLocked"></li>
    客户端地址：<li sec:authentication="details.remoteAddress"></li>
</ul>
<br/>
通过权限判断：<br/>
<button sec:authorize="hasAuthority('/insert')">新增</button>
<button sec:authorize="hasAuthority('/delete')">删除</button>
<button sec:authorize="hasAuthority('/update')">修改</button>
<button sec:authorize="hasAuthority('/select')">查询</button><br/>
通过角色判断：<br/>
<button sec:authorize="hasRole('abc')">新增</button>
<button sec:authorize="hasRole('abc')">删除</button>
<button sec:authorize="hasRole('abc')">修改</button>
<button sec:authorize="hasRole('abc')">查询</button>
</body>
</html>